//Student.java
package com.ylaihui.oop6;

public class Student extends Person {
	String id = "20300252"; // 学号
	String major;
	
	Student(){}
	Student(String id, String major){
		// "super(形参列表)"的使用，必须声明在子类构造器的首行
		// 子类的构造器中显式的使用"super(形参列表)"的方式，调用父类中声明的指定的构造器
		super(id);
		this.major = major;
	}
	
	public String getId(){
		return this.id;
	}
	
	public void showId(){
		System.out.println("this.id=" + this.id + ", super.id = " + super.id);
		System.out.println(this.getId());
		System.out.println(super.getId());
	}
}
